# src/utils/file_utils.py
import sys
import os

def resource_path(relative_path):
    """ 获取打包后的资源绝对路径 """
    if hasattr(sys, '_MEIPASS'):
        return os.path.join(sys._MEIPASS, relative_path)
    return os.path.join(os.path.abspath("."), relative_path)

# 使用示例
config_path = resource_path("resources/config.json")